
function getSum(arr:unknown[]):number{
    // console.log(arr);
    let newArr:number[]=[]
    arr.forEach(item=>{
        if(typeof(item)=="number"){
            newArr.push(item)
        }
    })
    
    for (let index = 0; index < newArr.length; index++) {
      for(let j=index+1;j<newArr.length;j++){
          if(newArr[index]==newArr[j]){
              newArr.splice(index, 1)
              index--
          }
      }
    }
    // console.log(newArr);
    
    let num:number=0
    num=newArr.reduce((prev,cur)=>{
        return prev+cur
    },0)
    return num
}

console.log(getSum([undefined,"23year",19,"097",1,"hello",null,1,19,1,1,1,19]));
